//
//  THFlowEarnStopTimeCell.m
//  YJB
//
//  Created by 中电大维 on 2017/1/19.
//  Copyright © 2017年 YJB. All rights reserved.
//

#import "THFlowEarnStopTimeCell.h"
NSString *const THFlowEarnStopTimeID = @"THFlowEarnStopTimeID";
@implementation THFlowEarnStopTimeCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.time];
        [self addSubview:self.award];
        [self setFrame];
        self.tintColor = kUIColorFromRGB(0xff783c);
    }
    return self;
}

- (void)setFrame{
    
//    CGFloat titlewidth = [NSString widthForString:@"任务标题" fontSize:16 andHeight:15];
    [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.mas_equalTo(0);
        make.width.mas_equalTo(self.mas_width).multipliedBy(0.5);
    }];
    [self.award mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.equalTo(self.time.mas_right);
        make.width.equalTo(self.time.mas_width);
    }];
//    [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.bottom.mas_equalTo(0);
//        make.left.mas_equalTo(0);
//        make.width.mas_equalTo(100);
//    }];
//    [self.award mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.bottom.mas_equalTo(0);
//        make.left.equalTo(self.time.mas_right).offset(10);
//        make.width.mas_equalTo(100);
//    }];
}

- (UILabel *)time
{
    if (!_time) {
        UILabel *time = [[UILabel alloc] init];
        time.font = FONT(16);
        time.textColor = kUIColorFromRGB(0x333333);
        time.text = @"15s";
        time.textAlignment = NSTextAlignmentCenter;
        _time = time;
    }
    return _time;
}

- (UILabel *)award
{
    if (!_award) {
        UILabel *award = [[UILabel alloc] init];
        award.font = FONT(14);
        award.textAlignment = NSTextAlignmentCenter;
        award.textColor = kUIColorFromRGB(0xff783c);
        award.text = @"5金币";
        _award = award;
    }
    return _award;
}

@end
